package com.my.own.config;

import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;

/**
 * 出站消息的处理
 * @author my
 *
 */
public class MyMqttPahoMessageHandler extends MqttPahoMessageHandler {

	public MyMqttPahoMessageHandler(String clientId, MqttPahoClientFactory clientFactory) {
		super(clientId, clientFactory);
	}

	/**
	 * 发布消息
	 */
	@Override
	public void messageArrived(String topic, MqttMessage message) throws Exception {
		publish(topic, message, null);
	}
}
